﻿@using VipSoft.CMS.Core.Enum
@using VipSoft.Web.Areas.VipSoft.Controllers
@using VipSoft.WebUtility
@model ArticleDto
@{
    ViewBag.Title = "管理首页";
    Layout = "~/Areas/VipSoft/Views/Shared/_AdminLayout.cshtml";
}
@section Style {

}

 
<div class="container-fluid">

    <div class="row">
        <div class="col-xs-12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="fa">
                        <i class="fa fa-align-justify"></i>
                    </span>
                    <h5>@ViewBag.SubTitle</h5>
                    <ul class="nav nav-tabs pull-right">
                        <li class="active"><a data-toggle="tab" href="#tab1r">基本信息</a></li>
                        <li style="display: none"><a data-toggle="tab" href="#tab3r">扩展属性</a></li>
                        <li style="display: none"><a data-toggle="tab" href="#tab2r">SEO选项</a></li>
                        <li>
                            <div class="buttons">
                                <a title="Icon Title" class="btn" href="@Url.Action("List", new { cid = @Request.RequestContext.RouteData.Values["cid"], mid = @Request.RequestContext.RouteData.Values["mid"] })"><i class="fa fa-reply"></i><span class="text">返回</span></a>
                            </div>
                        </li>
                    </ul>
                </div>

                 <form id="frmArticle" method="post" class="form-horizontal">
                    <div class="widget-content tab-content">
                        <div id="tab1r" class="tab-pane  active"> 
                            @if (Model.IsShowElement(ArticleElement.CategoryId))
                            {   
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.CategoryId)</label>
                                    <div class="controls">
                                        @Html.DropDownListFor(model => model.Article.CategoryId, (SelectList)ViewBag.Category, "---请选择---", new { @class = "select2 required" })
                                    </div>
                                </div> 
                            }
                            @if (Model.IsShowElement(ArticleElement.Title))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.Title)</label>
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Article.Title, new { @class = "form-control input-sm" })
                                        @Html.ValidationMessageFor(model => model.Article.Title)
                                    </div>
                                </div> 
                            }

                            @if (Model.IsShowElement(ArticleElement.FileName))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.FileName) </label>
                                    <div class="controls">
                                        <div id="swfu_container" style="margin: 3px 10px;">
                                            <div>
                                                <span id="spanButtonPlaceholder"></span>
                                            </div>
                                        </div>
                                        <div id="thumbnails">
                                            @Html.Raw(ViewBag.Picture)
                                        </div>
                                    </div>
                                </div> 
                            }



                            <div class="form-group" @if (!Model.IsShowElement(ArticleElement.Content))
                                                    {@Html.Raw("style = 'display:none;'")}>
                                <label class="control-label">@Html.LabelFor(model => model.Article.Content)</label>
                                <div class="controls">
                                    <script type="text/plain" id="UEContent" name="Article.Content"> 
                                            @Html.Raw(ViewBag.Count) 
                                    </script>
                                </div>
                            </div>
                            </div>

                        <div id="tab2r" class="tab-pane ">
                            @if (Model.IsShowElement(ArticleElement.SeoTitle))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model=>model.Article.SeoTitle)</label>
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Article.SeoTitle, new { @class = "form-control input-sm" })
                                        255个字符以内
                                        @Html.ValidationMessageFor(model => model.Article.SeoTitle)
                                    </div>
                                </div>
                            }
                            @if (Model.IsShowElement(ArticleElement.SeoKeywords))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model=>model.Article.SeoKeywords)</label>
                                    <div class="controls">
                                        @Html.TextAreaFor(model => model.Article.SeoKeywords, new { @class = "form-control input-sm" })
                                        以“,”逗号区分开，255个字符以内
                                        @Html.ValidationMessageFor(model => model.Article.SeoKeywords)
                                    </div>
                                </div>
                            }
                            @if (Model.IsShowElement(ArticleElement.SeoDescription))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model=>model.Article.SeoDescription)</label>
                                    <div class="controls">
                                        @Html.TextAreaFor(model => model.Article.SeoDescription, new { @class = "form-control input-sm" })
                                        255个字符以内
                                        @Html.ValidationMessageFor(model => model.Article.SeoDescription)
                                    </div>
                                </div>
                            }
                        </div>
                        <div id="tab3r" class="tab-pane">
                             @if (Model.IsShowElement(ArticleElement.Source))
                            {
                                  
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.Source)  </label>
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Article.Source, new { @class = "form-control input-sm" })
                                    </div>
                                </div>  
                            }
                            @if (Model.IsShowElement(ArticleElement.LinkUrl))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.LinkUrl)  </label>
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Article.LinkUrl, new { @class = "form-control input-sm" })
                                    </div>
                                </div>  
                            }

                           

                            @if (Model.IsShowElement(ArticleElement.Author))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.Author)</label>
                                    <div class="controls">
                                        @Html.TextBoxFor(model => model.Article.Author, new { @class = "form-control input-sm" })
                                    </div>
                                </div>  
                            }


                            @if (Model.IsShowElement(ArticleElement.Summary))
                            {
                                <div class="form-group">
                                    <label class="control-label">@Html.LabelFor(model => model.Article.Summary)</label>
                                    <div class="controls">
                                        @Html.TextAreaFor(model => model.Article.Summary, new { @class = "form-control input-sm" })
                                        <label style="display: none">不填将自动截取内容255个字符</label>
                                    </div>
                                </div>  
                            }
                        </div>
                        <div class="form-group">
                            <label class="control-label">@Html.ValidationSummary(true)</label>
                            <div class="controls">
                                <input type="hidden" id="mid" value="@Request.RequestContext.RouteData.Values["mid"]"/>
                                <input type="hidden" id="cid" value="@Request.RequestContext.RouteData.Values["cid"]"/>
                                @Html.HiddenFor(model => model.Article.ID)
                                <input type="submit" name="btnSubmit" value="提交保存" id="btnSave" class="btn btn-primary" />
                                &nbsp;<input name="重置" type="reset" class="btn btn-danger" value="重 置" />
                            </div>
                        </div>
                    </div>
                </form>
                </div>
            </div>
        </div>
    </div>
 
@section Script {

    <script src="@Url.Content("~/Scripts/UEditor/editor_config.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/UEditor/_examples/editor_api.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.custom.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap-colorpicker.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/bootstrap-datepicker.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.icheck.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jpanelmenu.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/unicorn.form_common.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/UEditor/third-party/swfupload/swfupload.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/swfupload.handlers.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/Admin/VipSoft.CMS.Article.js")" type="text/javascript"></script>
}